% test
clear all;clc
% a=[1 2]
% B{1,1}=[3 3]
% B{1,2}=[4 4]
% B{2,1}=[5 5]
% B{2,2}=[6 6]
% c=[7;8]
% for ii=1:4
% % for i=1:2
% %   d()
% % end
% d(ii)=[]
% end
c=[[0 ,5, 1] [1, 2, 3] [5, 6, 7]
   [2, 1, 3] [3,  4, 5]  [6, 7, 8]]
[m,n]=size(c)
for i=1:m
    for j=1:n/3
%        if j==1
%         cpx(i,j)=c(i,j)
%         cpy(i,j)=c(i,j+1)
%         cpz(i,j)=c(i,j+2)
          cpx(i,j)=c(i,3*(j-1)+1)
          cpy(i,j)=c(i,3*(j-1)+2)
          cpz(i,j)=c(i,3*(j-1)+3)
      % end
    end
end